
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	
NOTE: the do-files 00_master_wage_imp, 01_split_episodes, 04_merge_basic_BHP, 
05_educ_broad, 06_wages_assessment_ceiling, 07_wages_marginal, 
08_wages_deflation, and 10_wages_imputation build on the do-files offered by 
Heiko Stüber, Wolfgang Dauth, Johann Eppelsheimer (see blow) but were slightly 
adjusted to run the code on our sample of the BeH.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/


cap log close
if(${logfile}==1) log using ${log}\06_wages_assessment_ceiling.log, replace


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	
	Add contribution assessment ceiling (1975 - 2019)
	
	Generates the variable:
		- east: 1 if workplace in East Germany (incl. Berlin); 0 if West
		- limit_assess: contribution assessment ceiling
	
	Notes:
	In Germany there is a contribution assessment ceiling ("Beitragsbemessungsgrenze"). Hence, wages are right-cencored.
	The generation of the variable limit_assess is based on a FDZ-Arbeitshilfe (http://doku.iab.de/fdz/Bemessungsgrenzen_de_en.xls)
	Limits for the years 1975 - 2001 are converted from DM to EUR
	
	
	Author(s): Wolfgang Dauth, Johann Eppelsheimer, Heiko Stüber
	
	Version: 1.0
	Created: 2022-11-24

	Note: 
	This do-file is part of the Stata do-file collection offered as a 
	supplement to Stüber, Dauth, and Eppelsheimer (2023): A Guide to Preparing 
	the Sample of Integrated Labour Market Biographies (SIAB, version 7519 v1) 
	for Scientific Analysis. Journal for Labour Market Research, 57:7.
	https://doi.org/10.1186/s12651-023-00335-w

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/


********************************************************************************
* Generate east dummy (1 if WORKPLACE is in the eastern part of Germany; 0 if it is in the western part)
********************************************************************************
gen byte east = .
replace east = 1 if inlist(ao_bula, 11, 12, 13, 14, 15, 16)		// East: Berlin (from 1992 onward), Brandenburg, Mecklenburg-Western Pomerania, Saxony, Saxony-Anhalt, Thuringia
replace east = 0 if ao_bula < 11								// West: Schleswig-Holstein, Hamburg, Lower Saxony, Bremen, North Rhine-Westphalia, Hesse, Rhineland-Palatinate, Baden-Wuerttemberg, Bavaria, Saarland
replace east = 0 if ao_bula == 11 & jahr < 1992 				// West: Berlin (until 1991 onward)
label variable east "1 if workplace in East Germany (incl. Berlin from 1992 onward); 0 if West (incl. Berlin until 1991)"

if(${inspect}==1) tab ao_bula east, mis


********************************************************************************
* Set exact assessment ceiling
********************************************************************************
gen limit_assess = .
global exch = 1/1.95583		// exchange rate (EUR/DM)

* West 1975 - 1991 (incl. Berlin):
replace limit_assess =  92.05*$exch if jahr == 1975
replace limit_assess = 101.64*$exch if jahr == 1976
replace limit_assess = 111.78*$exch if jahr == 1977
replace limit_assess = 121.64*$exch if jahr == 1978
replace limit_assess = 131.51*$exch if jahr == 1979
replace limit_assess = 137.70*$exch if jahr == 1980
replace limit_assess = 144.66*$exch if jahr == 1981
replace limit_assess = 154.52*$exch if jahr == 1982
replace limit_assess = 164.38*$exch if jahr == 1983
replace limit_assess = 170.49*$exch if jahr == 1984
replace limit_assess = 177.53*$exch if jahr == 1985
replace limit_assess = 184.11*$exch if jahr == 1986
replace limit_assess = 187.40*$exch if jahr == 1987
replace limit_assess = 196.72*$exch if jahr == 1988
replace limit_assess = 200.55*$exch if jahr == 1989
replace limit_assess = 207.12*$exch if jahr == 1990
replace limit_assess = 213.70*$exch if jahr == 1991

* West 1992 - 2001 (excl. Berlin):
replace limit_assess = 222.95*$exch if east == 0 & jahr == 1992
replace limit_assess = 236.71*$exch if east == 0 & jahr == 1993
replace limit_assess = 249.86*$exch if east == 0 & jahr == 1994
replace limit_assess = 256.44*$exch if east == 0 & jahr == 1995
replace limit_assess = 262.30*$exch if east == 0 & jahr == 1996
replace limit_assess = 269.59*$exch if east == 0 & jahr == 1997
replace limit_assess = 276.16*$exch if east == 0 & jahr == 1998
replace limit_assess = 279.45*$exch if east == 0 & jahr == 1999
replace limit_assess = 281.97*$exch if east == 0 & jahr == 2000
replace limit_assess = 286.03*$exch if east == 0 & jahr == 2001

* West 2002 - 2019 (excl. Berlin):
replace limit_assess = 147.95 if east == 0 & jahr == 2002
replace limit_assess = 167.67 if east == 0 & jahr == 2003
replace limit_assess = 168.85 if east == 0 & jahr == 2004
replace limit_assess = 170.96 if east == 0 & jahr == 2005
replace limit_assess = 172.60 if east == 0 & jahr == 2006
replace limit_assess = 172.60 if east == 0 & jahr == 2007
replace limit_assess = 173.77 if east == 0 & jahr == 2008
replace limit_assess = 177.53 if east == 0 & jahr == 2009
replace limit_assess = 180.82 if east == 0 & jahr == 2010
replace limit_assess = 180.82 if east == 0 & jahr == 2011
replace limit_assess = 183.61 if east == 0 & jahr == 2012
replace limit_assess = 190.68 if east == 0 & jahr == 2013
replace limit_assess = 195.62 if east == 0 & jahr == 2014
replace limit_assess = 198.90 if east == 0 & jahr == 2015
replace limit_assess = 203.28 if east == 0 & jahr == 2016
replace limit_assess = 208.77 if east == 0 & jahr == 2017
replace limit_assess = 213.70 if east == 0 & jahr == 2018
replace limit_assess = 220.27 if east == 0 & jahr == 2019

* Note: after 1992 Berlin is assigned to East Germany

* East 1992 - 2001 (incl. Berlin)
replace limit_assess = 157.38*$exch if east == 1 & jahr == 1992
replace limit_assess = 174.25*$exch if east == 1 & jahr == 1993
replace limit_assess = 193.97*$exch if east == 1 & jahr == 1994
replace limit_assess = 210.41*$exch if east == 1 & jahr == 1995
replace limit_assess = 222.95*$exch if east == 1 & jahr == 1996
replace limit_assess = 233.42*$exch if east == 1 & jahr == 1997
replace limit_assess = 230.14*$exch if east == 1 & jahr == 1998
replace limit_assess = 236.71*$exch if east == 1 & jahr == 1999
replace limit_assess = 232.79*$exch if east == 1 & jahr == 2000
replace limit_assess = 240.00*$exch if east == 1 & jahr == 2001

* East 2002 - 2019 (incl. Berlin)
replace limit_assess = 123.29 if east == 1 & jahr == 2002
replace limit_assess = 139.73 if east == 1 & jahr == 2003
replace limit_assess = 142.62 if east == 1 & jahr == 2004
replace limit_assess = 144.66 if east == 1 & jahr == 2005
replace limit_assess = 144.66 if east == 1 & jahr == 2006
replace limit_assess = 149.59 if east == 1 & jahr == 2007
replace limit_assess = 147.54 if east == 1 & jahr == 2008
replace limit_assess = 149.59 if east == 1 & jahr == 2009
replace limit_assess = 152.88 if east == 1 & jahr == 2010
replace limit_assess = 157.80 if east == 1 & jahr == 2011
replace limit_assess = 157.38 if east == 1 & jahr == 2012
replace limit_assess = 161.10 if east == 1 & jahr == 2013
replace limit_assess = 164.38 if east == 1 & jahr == 2014
replace limit_assess = 170.96 if east == 1 & jahr == 2015
replace limit_assess = 177.05 if east == 1 & jahr == 2016
replace limit_assess = 187.40 if east == 1 & jahr == 2017
replace limit_assess = 190.68 if east == 1 & jahr == 2018
replace limit_assess = 202.19 if east == 1 & jahr == 2019


********************************************************************************
* Label
********************************************************************************
label variable limit_assess "Contribution assessment ceiling"

cap log close
